-
Notifications
You must be signed in to change notification settings - Fork 602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[node-core-library] Add support for alreadyExistsBehavior
for symlinks and junctions
#2884
[node-core-library] Add support for alreadyExistsBehavior
for symlinks and junctions
#2884
Conversation
alreadyExistsBehavior
for symlinks and junctionsalreadyExistsBehavior
for symlinks and junctions
@octogonz - let me know once you get a chance to test this so that we can get this merged, since it seems like a big hole in NCL. |
I should have some time tomorrow. |
Looking at this, I'm increasingly uncomfortable with the idea that |
Summary
Add support for
alreadyExistsBehavior
for symlinks and junctions to align with hardlinks. Additionally, fix various error scenarios that can be encountered for all types of links.Details
Support for
alreadyExistsBehavior
was added for hardlinks in #2333, however it was not wired up for symlinks and junctions even though the options interface was used by these methods as well.Additionally, while adding support for these types of links, it was realized that there were a few error scenarios that were not being handled correctly:
AlreadyExistsBehavior.overwrite
would delete the existing file but not create the new linkAlreadyExistsBehavior.overwrite
would fail if the existing entity is a directory instead of a filelinkTargetPath
may or may not exist depending on the type of link being created, causing symlinks and junctions to non-existent files to fail (even though they are valid)How it was tested
Tested each link type in a local sandbox to probe error-handling scenarios, namely:
AlreadyExistsBehavior.overwrite